package com.zretc.service.impl;

import com.zretc.dao.SalaryMapper;
import com.zretc.entity.Salary;
import com.zretc.service.SalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SalaryServiceImpl implements SalaryService {

    @Autowired
    private SalaryMapper salaryMapper;
    @Override
    public int addSalary(Salary salary) {
        return salaryMapper.addSalary(salary);
    }

    @Override
    public int delete(Integer SalaryId) {
        return salaryMapper.delete(SalaryId);
    }

    @Override
    public int updata(Salary salary) {
        return salaryMapper.updata(salary);
    }

    @Override
    public List<Salary> findAll(Map<String, Object> map) {
        String name = (String) map.get("name");
        if (name==""){
            map.put("name",null);
        }
        return salaryMapper.findAll(map);
    }
}
